Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 skin-theme-clientpref-day vector-sticky-header-enabled" lang="de" dir="ltr"><head>
<meta charset="UTF-8">
<title>Go (Programmiersprache)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="./_res_/favicon.png">
<link rel="canonical" href="https://de.wikipedia.org/wiki/Go_(Programmiersprache)"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link href="./_mw_/ext.gadget.citeRef.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.defaultPlainlinks.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiCommonHide.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiCommonLayout.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiCommonStyle.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiDarkmode.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.dewikiResponsive.css" rel="stylesheet" type="text/css">
<link href="./_mw_/ext.gadget.specialSearch.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
<link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
<link rel="stylesheet" type="text/css" href="./_res_/footer.css">
<link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Go_Programmiersprache rootpage-Go_Programmiersprache skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Go (Programmiersprache)</span></h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="contentSub">
<div id="mw-content-subtitle"></div>
</div>
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="de" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="de" dir="ltr"><table class="float-right infobox toccolours toptextcells" style="font-size:90%; margin-top:0; width:21em;">

<tbody><tr>
<th colspan="2" class="hintergrundfarbe6" style="font-size:larger;">Go
</th></tr>
<tr>
<td colspan="2" class="notheme" style="text-align:center; background-color:#f8f9fa;"><span typeof="mw:File"></span>
</td></tr>


<tr>
<th colspan="2" class="hintergrundfarbe5" style="font-size:105%; text-align:center;">Basisdaten
</th></tr>
<tr>
<td><b><a href="Programmierparadigma" title="Programmierparadigma">Paradigmen</a>:</b>
</td>
<td><a href="Nebenl%C3%A4ufigkeit" title="Nebenläufigkeit">nebenläufig</a>, <a href="Imperative_Programmierung" title="Imperative Programmierung">imperativ</a>, <a href="Strukturierte_Programmierung" title="Strukturierte Programmierung">strukturiert</a>, <a href="Modulare_Programmierung" title="Modulare Programmierung">modular</a>, <a href="Objektorientierte_Programmierung" title="Objektorientierte Programmierung">objektorientiert</a>, <a href="Generische_Programmierung" title="Generische Programmierung">generisch</a>
</td></tr>
<tr>
<td><b>Erscheinungsjahr:</b>
</td>
<td>2009; erste stabile Version 2012
</td></tr>

<tr>
<td><b>Designer:</b>
</td>
<td><span class="wikidata-content"><a href="Rob_Pike" title="Rob Pike">Rob Pike</a>, <a href="Ken_Thompson" title="Ken Thompson">Ken Thompson</a>, <a href="Robert_Griesemer" title="Robert Griesemer">Robert Griesemer</a></span>
</td></tr>
<tr>
<td><b>Entwickler:</b>
</td>
<td><a href="Robert_Griesemer" title="Robert Griesemer">Robert Griesemer</a>, <a href="Rob_Pike" title="Rob Pike">Rob Pike</a>, <a href="Ken_Thompson" title="Ken Thompson">Ken Thompson</a> u.&nbsp;a.
</td></tr>
<tr>
<td><b>Aktuelle&nbsp;<a href="Version_(Software)" title="Version (Software)">Version</a></b>
</td>
<td class="wikidata-content" style="white-space:nowrap;">1.25.5<sup id="cite_ref-_9774563ad02d3acd_1-0" class="reference"><a href="#cite_note-_9774563ad02d3acd-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>&nbsp;<small>(2. Dezember 2025)</small>
</td></tr>


<tr>
<td><b><a href="Typisierung_(Informatik)" title="Typisierung (Informatik)">Typisierung</a>:</b>
</td>
<td><a href="Starke_Typisierung" title="Starke Typisierung">stark</a>, <a href="Statische_Typisierung" title="Statische Typisierung">statisch</a>
</td></tr>
<tr>
<td><b>Wichtige <a href="Implementierung" title="Implementierung">Implementierungen</a>:</b>
</td>
<td>Gc, gccgo
</td></tr>




<tr>
<td><b>Beeinflusst von:</b>
</td>
<td><a href="C_(Programmiersprache)" title="C (Programmiersprache)">C</a>, <a href="Newsqueak" title="Newsqueak">Newsqueak</a>, <a href="Alef_(Programmiersprache)" title="Alef (Programmiersprache)">Alef</a>, <a href="Limbo_(Programmiersprache)" title="Limbo (Programmiersprache)">Limbo</a>, <a href="Oberon_(Programmiersprache)" title="Oberon (Programmiersprache)">Oberon</a>
</td></tr>


<tr>
<td><b><a href="Betriebssystem" title="Betriebssystem">Betriebssystem</a>:</b>
</td>
<td><a href="Linux" title="Linux">Linux</a>, <a href="MacOS" title="MacOS">macOS</a>, <a href="FreeBSD" title="FreeBSD">FreeBSD</a>, <a href="Microsoft_Windows" title="Microsoft Windows">Windows</a>, <a href="Google_Fuchsia" title="Google Fuchsia">Fuchsia</a>, Experimentell: <a href="DragonFly_BSD" title="DragonFly BSD">DragonFly BSD</a>, <a href="Plan_9_(Betriebssystem)" title="Plan 9 (Betriebssystem)">Plan 9</a>, <a href="Solaris_(Betriebssystem)" title="Solaris (Betriebssystem)">Solaris</a>, <a href="Z/OS" title="Z/OS">z/OS</a>
</td></tr>

<tr>
<td><b><a href="Lizenz" title="Lizenz">Lizenz</a>:</b>
</td>
<td><span class="wikidata-content"><a href="BSD-Lizenz" title="BSD-Lizenz">BSD-Lizenz</a></span>
</td></tr>
<tr>
<td colspan="2" class="hintergrundfarbe5" style="text-align:center;"><a rel="nofollow" class="external text" href="https://go.dev/">go.dev</a>
</td></tr></tbody></table>
<p><b>Go</b> (auch <b>Golang</b>) ist eine <a href="Kompilierung" class="mw-redirect" title="Kompilierung">kompilierbare</a> <a href="Programmiersprache" title="Programmiersprache">Programmiersprache</a>, die <a href="Nebenl%C3%A4ufigkeit" title="Nebenläufigkeit">Nebenläufigkeit</a> und <a href="Garbage_Collection" title="Garbage Collection">automatische Speicherbereinigung</a> unterstützt. Entwickelt wurde Go von Mitarbeitern des Unternehmens <a href="Google_Inc." class="mw-redirect" title="Google Inc.">Google Inc.</a><sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> Die Entwürfe stammen von <a href="Robert_Griesemer" title="Robert Griesemer">Robert Griesemer</a>, <a href="Rob_Pike" title="Rob Pike">Rob Pike</a> und <a href="Ken_Thompson" title="Ken Thompson">Ken Thompson</a>.
</p>

<div class="mw-heading mw-heading2"><h2 id="Überblick"><span id=".C3.9Cberblick"></span>Überblick</h2></div>
<p>Go wurde von Google entwickelt, um Problemen, die C, C++, Java und Co. mit sich brachten, zu begegnen. Insbesondere Probleme im Hinblick auf <a href="Skalierbarkeit" title="Skalierbarkeit">skalierbare</a> <a href="Netzwerkdienst" title="Netzwerkdienst">Netzwerkdienste</a>, <a href="Rechnerverbund" title="Rechnerverbund">Cluster</a>- und <a href="Cloud_Computing" title="Cloud Computing">Cloud Computing</a> haben das Team dazu geführt, Go zu entwickeln.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> Vor allem hat Go viel weniger <a href="Schl%C3%BCsselwort_(Programmierung)" title="Schlüsselwort (Programmierung)">Schlüsselwörter</a> als die Sprachen aus der C-Familie. Zudem sollte Go eins lösen: die Compiler-Ineffizienz in der C-Familie. Wichtige Ziele bei der Entwicklung waren unter anderem die Unterstützung von Nebenläufigkeit mit nativen Sprachelementen und die Erleichterung der Softwareentwicklung mit großen Entwicklerteams und großen <a href="Codebasis" title="Codebasis">Codebasen</a>.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> Go besitzt einen eigenen <a href="Garbage_Collector" class="mw-redirect" title="Garbage Collector">Garbage Collector</a>, erlaubt die Verwendung von <a href="Zeiger_(Informatik)" title="Zeiger (Informatik)">Zeigern</a>, verzichtet jedoch auf <a href="Zeigerarithmetik" class="mw-redirect" title="Zeigerarithmetik">Zeigerarithmetik</a>.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> Go ist eine kompilierte Sprache, bei der Wert auf eine hohe Übersetzungsgeschwindigkeit gelegt wurde.
</p><p>Go orientiert sich syntaktisch an der Programmiersprache <a href="C_(Programmiersprache)" title="C (Programmiersprache)">C</a> mit einigem Einfluss aus der <a href="Niklaus_Wirth" title="Niklaus Wirth">Wirthschen</a> Sprachfamilie (<a href="Pascal_(Programmiersprache)" title="Pascal (Programmiersprache)">Pascal</a>, <a href="Modula-2" title="Modula-2">Modula</a> und insbesondere <a href="Oberon_(Programmiersprache)" title="Oberon (Programmiersprache)">Oberon</a>). Die Unterstützung für Nebenläufigkeit wurde nach Vorbild der von <a href="Tony_Hoare" title="Tony Hoare">Tony Hoare</a> eingeführten <a href="Communicating_Sequential_Processes" title="Communicating Sequential Processes">Communicating Sequential Processes</a> (CSP) gestaltet und steht in Tradition der Programmiersprachen <a href="Newsqueak" title="Newsqueak">Newsqueak</a>, <a href="Alef_(Programmiersprache)" title="Alef (Programmiersprache)">Alef</a> und <a href="Limbo_(Programmiersprache)" title="Limbo (Programmiersprache)">Limbo</a>.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Merkmale_und_Sprachmittel">Merkmale und Sprachmittel</h2></div>
<p>Go bietet <a href="Closure_(Funktion)" title="Closure (Funktion)">Closures</a> und <a href="Reflexion_(Programmierung)" title="Reflexion (Programmierung)">Reflexion</a><sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> sowie <a href="Typsicherheit" title="Typsicherheit">Typsicherheit</a> und eine automatische Speicherbereinigung.
<a href="Objektorientierte_Programmierung" title="Objektorientierte Programmierung">Objektorientierung</a> unterstützt Go durch <a href="Schnittstelle_(Objektorientierung)" title="Schnittstelle (Objektorientierung)">Interfaces</a> und <a href="Mixin" title="Mixin">Mixins</a>. Auf <a href="Klasse_(Objektorientierung)" title="Klasse (Objektorientierung)">Klassen</a> und <a href="Vererbung_(Programmierung)" title="Vererbung (Programmierung)">Vererbung</a> von Klassen wird bewusst verzichtet. Außerdem ist es möglich, den <a href="Quelltext" title="Quelltext">Quellcode</a> wie bei <a href="Java_(Programmiersprache)" title="Java (Programmiersprache)">Java</a> durch Pakete zu modularisieren.
</p><p>Nebenläufigkeit wird durch <a href="Communicating_Sequential_Processes" title="Communicating Sequential Processes">Communicating Sequential Processes</a> realisiert, die <i>Goroutinen</i> genannt werden und über Kanäle <i>(Channels)</i> miteinander kommunizieren können. <a href="Generischer_Typ" title="Generischer Typ">Generische Typen</a> wurden in Version 1.18 eingeführt.<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>
</p><p><a href="Unicode" title="Unicode">Unicode</a> wird in Form von <a href="UTF-8" title="UTF-8">UTF-8</a> unterstützt, sowohl für <a href="Zeichenkette" title="Zeichenkette">Strings</a> als auch für Variablen<a href="Bezeichner" title="Bezeichner">bezeichner</a> im Quelltext (allerdings nur Unicode-Buchstaben und -Ziffern), <code>Δt = t2 - t1</code> ist also möglich.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Syntax">Syntax</h2></div>
<p>Die <a href="Syntax" title="Syntax">Syntax</a> von Go orientiert sich im Wesentlichen an der Syntax der Programmiersprache <a href="C_(Programmiersprache)" title="C (Programmiersprache)">C</a>, weicht davon aber an einigen Stellen ab. So kann beispielsweise auf den Abschluss von <a href="Anweisung_(Programmierung)" title="Anweisung (Programmierung)">Anweisungen</a> durch ein <a href="Semikolon" title="Semikolon">Semikolon</a> verzichtet werden. Datentypen werden bei <a href="Deklaration_(Programmierung)" title="Deklaration (Programmierung)">Deklarationen</a> hinter den Bezeichner geschrieben statt davor, um die Deklaration von Funktionstypen zu vereinfachen.<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> Code-Blöcke werden mit <a href="Klammer_(Zeichen)#Geschweifte/geschwungene_Klammern_(Akkoladen)" title="Klammer (Zeichen)">geschweiften Klammern</a> abgegrenzt. Neben dem einfachen <a href="Gleichheitszeichen" title="Gleichheitszeichen">Gleichheitszeichen</a> als <a href="Zuweisung" title="Zuweisung">Zuweisungsoperator</a> gibt es zusätzlich den Operator <code>:=</code>, der Deklaration mit <a href="Typinferenz" title="Typinferenz">Typinferenz</a> und Zuweisung kombiniert. Die Sprache umfasst mit 25 <a href="Schl%C3%BCsselwort_(Programmierung)" title="Schlüsselwort (Programmierung)">Schlüsselwörtern</a> weniger Schlüsselwörter als <a href="Varianten_der_Programmiersprache_C" title="Varianten der Programmiersprache C">ANSI C</a>.
</p><p>Kommentare werden wie in C oder C++ mit Schrägstrichen markiert; <code>/*</code> bis <code>*/</code> bezeichnet einen <a href="Kommentar_(Programmierung)" title="Kommentar (Programmierung)">Kommentar</a>, der auch mehrere Zeilen enthalten kann, <code>//</code> leitet einen Kommentar bis zum Ende der Zeile ein.
</p><p>Jede Quelldatei gehört genau einem Paket an, das am Anfang der Datei mit der <code>package</code>-Anweisung angegeben wird.
</p><p>Das Schlüsselwort für <a href="Funktion_(Programmierung)" title="Funktion (Programmierung)">Funktionen</a> lautet <code>func</code>, die Funktion <code>main</code> in dem „main“-Paket ist der <a href="Einsprungpunkt" title="Einsprungpunkt">Einsprungpunkt</a> des Go-Programms. Funktionen können mehrere Werte zurückgeben. Es ist üblich, als letzten <a href="Return_Code" title="Return Code">Rückgabewert</a> den Status über den Erfolg oder Misserfolg des Funktionsaufrufs zu übermitteln und sogleich mit einer <a href="Bedingte_Anweisung_und_Verzweigung" title="Bedingte Anweisung und Verzweigung">bedingten</a> <a href="Kontrollstruktur" title="Kontrollstruktur">Kontrollstruktur</a> zu überprüfen.
</p><p>Jede Variable hat einen definierten Typ. Jede Variable, mit Ausnahme des „Blank identifier“ <code>_</code>, muss verwendet werden. Der „Blank identifier“ ignoriert eine Zuweisung, er ist ein anonymer <a href="Wildcard_(Informatik)" title="Wildcard (Informatik)">Platzhalter</a>.
</p><p>Die Prüfung einer Bedingung in einer Kontrollstruktur wie <code>if</code>, <code>for</code> oder <code>switch</code> wird anders als bei anderen Sprachen nicht von Klammern umschlossen.
</p>
<div class="mw-heading mw-heading2"><h2 id="Einfache_Beispiele">Einfache Beispiele</h2></div>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="kn">package</span><span class="w"> </span><span class="nx">main</span>

<span class="kn">import</span><span class="w"> </span><span class="s">"fmt"</span>

<span class="kd">func</span><span class="w"> </span><span class="nx">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="s">"Hallo Welt"</span><span class="p">)</span>
<span class="p">}</span>
</pre></div>
<p>Das obige <a href="Hallo-Welt-Programm" title="Hallo-Welt-Programm">Hallo-Welt-Programm</a> gibt am Ausgabemedium den String <code>Hallo Welt</code> aus.
</p><p>Ein weiteres Beispiel berechnet die <a href="Kreiszahl" title="Kreiszahl">Kreiszahl</a> Pi näherungsweise über die <a href="Leibniz-Reihe" title="Leibniz-Reihe">Leibniz-Reihe</a>.
Für die Berechnung werden nichtsequentielle Go-Routinen und ein Kanal verwendet:
</p>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="kn">package</span><span class="w"> </span><span class="nx">main</span>

<span class="kn">import</span><span class="w"> </span><span class="p">(</span>
<span class="w"> </span><span class="s">"fmt"</span>
<span class="w"> </span><span class="s">"math"</span>
<span class="p">)</span>

<span class="kd">func</span><span class="w"> </span><span class="nx">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="nx">calcpi</span><span class="p">(</span><span class="mi">5000</span><span class="p">))</span>
<span class="p">}</span>

<span class="c1">// calcpi startet n Goroutinen, um eine</span>
<span class="c1">// Näherung von Pi zu berechnen.</span>
<span class="kd">func</span><span class="w"> </span><span class="nx">calcpi</span><span class="p">(</span><span class="nx">n</span><span class="w"> </span><span class="kt">int</span><span class="p">)</span><span class="w"> </span><span class="kt">float64</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">ch</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nb">make</span><span class="p">(</span><span class="kd">chan</span><span class="w"> </span><span class="kt">float64</span><span class="p">,</span><span class="w"> </span><span class="nx">n</span><span class="p">)</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">k</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">k</span><span class="w"> </span><span class="p">&lt;</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">k</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// alle n Werte nichtsequentiell berechnen</span>
<span class="w"> </span><span class="k">go</span><span class="w"> </span><span class="nx">calcsubterm</span><span class="p">(</span><span class="nx">ch</span><span class="p">,</span><span class="w"> </span><span class="nb">float64</span><span class="p">(</span><span class="nx">k</span><span class="p">))</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="c1">// das Ergebnis mit Null initialisieren</span>
<span class="w"> </span><span class="nx">f</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nb">float64</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">k</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">k</span><span class="w"> </span><span class="p">&lt;</span><span class="w"> </span><span class="nx">n</span><span class="p">;</span><span class="w"> </span><span class="nx">k</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// alle n Werte addieren</span>
<span class="w"> </span><span class="nx">f</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="o">&lt;-</span><span class="nx">ch</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="nx">f</span><span class="o">*</span><span class="mi">4</span><span class="w"> </span><span class="c1">//Die Leibniz-Reihe berechnet Pi/4</span>
<span class="p">}</span>

<span class="c1">// berechnet das k-Element der Leibniz-Reihe</span>
<span class="kd">func</span><span class="w"> </span><span class="nx">calcsubterm</span><span class="p">(</span><span class="nx">ch</span><span class="w"> </span><span class="kd">chan</span><span class="o">&lt;-</span><span class="w"> </span><span class="kt">float64</span><span class="p">,</span><span class="w"> </span><span class="nx">k</span><span class="w"> </span><span class="kt">float64</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">ch</span><span class="w"> </span><span class="o">&lt;-</span><span class="w"> </span><span class="nx">math</span><span class="p">.</span><span class="nx">Pow</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="nx">k</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="nx">k</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span>
<span class="p">}</span>
</pre></div>
<p>Die einzelnen <a href="Summand" class="mw-redirect" title="Summand">Summanden</a> der <a href="Reihe_(Mathematik)" title="Reihe (Mathematik)">mathematischen Reihe</a> werden nichtsequentiell ausgeführt und schreiben ihre Ergebnisse jeweils in den Kanal <code>ch</code>. Gleichzeitig werden die Werte aus dem Kanal zu einem Gesamtergebnis addiert. Am <a href="Ausgabeger%C3%A4t" title="Ausgabegerät">Ausgabegerät</a> erscheint die Ziffernfolge <code>3.141392653591793</code>.<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup> Die Abweichung zur eigentlichen Kreiszahl ab der vierten Nachkommastelle ist vor allem auf die langsame Konvergenz der <a href="Leibniz-Reihe" title="Leibniz-Reihe">Leibniz-Reihe</a> zurückzuführen.
</p>
<div class="mw-heading mw-heading2"><h2 id="Typkonvertierung">Typkonvertierung</h2></div>
<p>Anders als bei der Sprache C müssen Typen immer konvertiert werden. Es ist zum Beispiel nicht möglich, einen Wert vom Typ <a href="Integer_(Datentyp)" title="Integer (Datentyp)">Integer</a> in einer Variable vom Typ <a href="Gleitkommazahl" title="Gleitkommazahl">Float</a> zu speichern, ohne den Wert vorher zu konvertieren. Im folgenden Beispiel wird eine Variable vom Typ Integer deklariert und der Wert dieser Variable einer anderen Variable vom Typ Float zugewiesen. Man beachte, dass zwischen <code>int</code> und <code>uint</code> unterschieden wird. 8-<a href="Bit" title="Bit">Bit</a>-„Unsigned Integer“ <code>uint8</code> umfassen einen Bereich von (0 … 255) während <code>int8</code> einen Bereich von (−128 … 127) umfassen. Diese Vorgehensweise der strikten Typisierung ist sehr sinnvoll, da schwer zu findende <a href="Programmfehler" title="Programmfehler">Programmierfehler</a> so leichter erkannt werden können.
</p>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="mi">100</span>
<span class="kd">var</span><span class="w"> </span><span class="nx">f</span><span class="w"> </span><span class="kt">float64</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">float64</span><span class="p">(</span><span class="nx">i</span><span class="p">)</span>
<span class="kd">var</span><span class="w"> </span><span class="nx">u</span><span class="w"> </span><span class="kt">uint</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nb">uint</span><span class="p">(</span><span class="nx">f</span><span class="p">)</span>
</pre></div>
<p>Sofern bei der Deklaration direkt ein Wert zugewiesen wird, ist die explizite Nennung des Typs optional. Der Compiler ermittelt ihn anhand des Wertes oder der angegebenen Typenkonverterfunktionen. Auf Paketebene muss jede Anweisung mit einem Schlüsselwort beginnen, deshalb kann die folgende Kurzform nur innerhalb von Funktionen verwendet werden:
</p>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="nx">i</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">100</span>
<span class="nx">f</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nb">float64</span><span class="p">(</span><span class="nx">i</span><span class="p">)</span>
<span class="nx">u</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nb">uint</span><span class="p">(</span><span class="nx">f</span><span class="p">)</span>
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Zeiger">Zeiger</h2></div>
<p>Im Gegensatz zu vielen Hochsprachen wie Java arbeitet die Programmiersprache Go mit Zeigern. Ein Zeiger (<a href="Englische_Sprache" title="Englische Sprache">englisch</a> <i>pointer</i>) enthält als Wert die <a href="Speicheradresse" title="Speicheradresse">Adresse eines Speicherbereichs</a>. Bestimmte Aufgaben können ohne Zeiger nicht programmiert werden. Dazu gehört die Übergabe von Werten an Funktionen (<a href="Referenzparameter" title="Referenzparameter">Call by reference</a>). Im folgenden Beispiel wird eine Variable vom Typ Integer mit dem Namen „n“ und dem Wert 100 initialisiert. Anschließend wird die Speicheradresse, also die Adresse im Speicher des Computers ausgegeben. Die Adresse der Variable „n“ wird also mit <code>&amp;n</code> abgerufen. Die Syntax der Zeiger erinnert stark an die Sprache C.
</p>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">n</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="mi">100</span>
<span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="s">"Die Adresse der Variable:"</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="nx">n</span><span class="p">)</span>
<span class="c1">// Beispiel-Ausgabe: 0xc000018030</span>
</pre></div>
<p>Im nächsten Beispiel wird wieder eine Variable vom Typ Integer mit dem Namen „n“ und dem Wert 100 initialisiert. Dann wird eine Pointer-Variable vom Typ Integer-Zeiger deklariert. Der Typ einer Zeiger-Variable wird durch einen führenden <a href="Sternchen_(Schriftzeichen)" title="Sternchen (Schriftzeichen)">Asterisk</a> (<code>*</code>) vor dem <a href="Variablentyp" class="mw-redirect" title="Variablentyp">Variablentyp</a> deklariert. Aus <code>int</code> wird <code>*int</code>. Anschließend wird die Speicheradresse der Variable „n“ als Wert der Zeiger-Variable „p“ deklariert. Daraufhin wird jene Adresse des Speichers ausgegeben, die von der Variable „n“ belegt wurde. Zuletzt wird jener Wert ausgegeben, der sich in der Speicheradresse befindet. Der Wert einer Speicherstelle, der in der Zeiger-Variable „p“ deklariert ist, kann mit <code>*p</code> ermittelt werden.
</p>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">n</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="mi">100</span>
<span class="kd">var</span><span class="w"> </span><span class="nx">p</span><span class="w"> </span><span class="o">*</span><span class="kt">int</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="o">&amp;</span><span class="nx">n</span>

<span class="c1">// Gibt eine Speicheradresse aus, z.B. 0xc000018030</span>
<span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="s">"Adresse gespeichert in der Zeiger-Variable p:"</span><span class="p">,</span><span class="w"> </span><span class="nx">p</span><span class="p">)</span>

<span class="c1">// Gibt den Wert an, der in der Speicheradresse steht: 100</span>
<span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="s">"Wert der Speicheradresse gespeichert in p:"</span><span class="p">,</span><span class="w"> </span><span class="o">*</span><span class="nx">p</span><span class="p">)</span>
</pre></div>
<p>Eine Zeiger-Adresse ohne gespeicherten Zeiger wird „nil pointer“ genannt. Man kann einfach abfragen, ob eine Zeigeradresse eine Speicheradresse als Inhalt hat oder nicht.
</p>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="k">if</span><span class="w"> </span><span class="nx">p</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// Wenn zutreffend: Zeiger-Variable speichert einen Zeiger auf einen Speicherbereich</span>
<span class="p">}</span>
<span class="k">if</span><span class="w"> </span><span class="nx">p</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// Wenn zutreffend: Zeiger-Variable speichert keinen Zeiger auf einen Speicherbereich</span>
<span class="p">}</span>
</pre></div>
<p>Im letzten Beispiel soll die Verwendung beim Aufruf einer Funktion dargestellt werden. Zuerst werden zwei Variablen vom Typ Integer deklariert. Der Inhalt dieser zwei Variablen soll getauscht werden.
</p>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="kn">package</span><span class="w"> </span><span class="nx">main</span>

<span class="kn">import</span><span class="w"> </span><span class="s">"fmt"</span>

<span class="kd">func</span><span class="w"> </span><span class="nx">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">a</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">10</span>
<span class="w"> </span><span class="nx">b</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">50</span>

<span class="w"> </span><span class="c1">// Anzeige vor dem Tausch</span>
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="s">"Wert der Variable a:"</span><span class="p">,</span><span class="w"> </span><span class="nx">a</span><span class="p">)</span>
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="s">"Wert der Variable b:"</span><span class="p">,</span><span class="w"> </span><span class="nx">b</span><span class="p">)</span>

<span class="w"> </span><span class="c1">// Aufruf der Funktion tauschen</span>
<span class="w"> </span><span class="nx">tauschen</span><span class="p">(</span><span class="o">&amp;</span><span class="nx">a</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="nx">b</span><span class="p">)</span>

<span class="w"> </span><span class="c1">// Anzeige des Tausches</span>
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="s">"Wert der Variable a:"</span><span class="p">,</span><span class="w"> </span><span class="nx">a</span><span class="p">)</span>
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="s">"Wert der Variable b:"</span><span class="p">,</span><span class="w"> </span><span class="nx">b</span><span class="p">)</span>
<span class="p">}</span>

<span class="c1">// Funktion tauschen</span>
<span class="kd">func</span><span class="w"> </span><span class="nx">tauschen</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span><span class="w"> </span><span class="nx">b</span><span class="w"> </span><span class="o">*</span><span class="kt">int</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">tmp</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="o">*</span><span class="nx">a</span>
<span class="w"> </span><span class="o">*</span><span class="nx">a</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="o">*</span><span class="nx">b</span>
<span class="w"> </span><span class="o">*</span><span class="nx">b</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">tmp</span>
<span class="p">}</span>
</pre></div>
<p>Man kann also grob zusammenfassen, dass <code>&amp;</code> die Speicheradresse einer Variable ermittelt, während <code>*</code> den gespeicherten Wert einer Speicheradresse ermittelt.<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Objektorientierung">Objektorientierung</h2></div>
<p>Go unterstützt objektorientierte Programmierung, sie ist jedoch nicht <a href="Klasse_(Objektorientierung)" title="Klasse (Objektorientierung)">klassenbasiert</a>. Datentypen können in Go <a href="Methode_(Programmierung)" title="Methode (Programmierung)">Methoden</a> besitzen. <a href="Polymorphie_(Programmierung)" title="Polymorphie (Programmierung)">Polymorphie</a> wird über <i>Interfaces</i> (<a href="Schnittstelle" title="Schnittstelle">Schnittstellen</a>) erreicht, über die Methodenaufrufe zur Laufzeit an die konkrete Implementierung gebunden werden (<a href="Dynamische_Bindung" title="Dynamische Bindung">Dynamische Bindung</a>). Für einen Datentyp muss nicht explizit deklariert werden, dass er ein bestimmtes Interface erfüllt. Diese Beziehung wird stattdessen implizit beim Kompilieren ermittelt, um lose <a href="Kopplung_(Softwareentwicklung)" title="Kopplung (Softwareentwicklung)">Kopplung</a> zu erreichen.
</p><p>Statt <a href="Vererbung_(Programmierung)" title="Vererbung (Programmierung)">Vererbung</a> und Typ-Hierarchien kommt in Go Komposition zum Einsatz. Hierfür unterstützt Go eine Form von Mixins, die in Go <i>embedding</i> („Einbettung“) genannt wird: Eine <a href="Datenstruktur" title="Datenstruktur">Datenstruktur</a> kann beliebig viele andere Datentypen einbetten, sodass sie deren Methoden und Datenfelder erhält.
</p><p>Beispiel zu Typen, Interfaces und Mixins:
</p>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="kn">package</span><span class="w"> </span><span class="nx">main</span>

<span class="kn">import</span><span class="w"> </span><span class="s">"fmt"</span>

<span class="c1">// Definieren zweier Typen</span>
<span class="kd">type</span><span class="w"> </span><span class="nx">User</span><span class="w"> </span><span class="kd">struct</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">Name</span><span class="w"> </span><span class="kt">string</span>
<span class="p">}</span>

<span class="kd">type</span><span class="w"> </span><span class="nx">Admin</span><span class="w"> </span><span class="kd">struct</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">User</span><span class="w"> </span><span class="c1">// Admin bettet zudem den Typ 'User' ein</span>
<span class="w"> </span><span class="nx">Email</span><span class="w"> </span><span class="kt">string</span>
<span class="p">}</span>

<span class="c1">// Ein Interface mit der Methode 'Notify()'</span>
<span class="kd">type</span><span class="w"> </span><span class="nx">Notifier</span><span class="w"> </span><span class="kd">interface</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">Notify</span><span class="p">()</span>
<span class="p">}</span>

<span class="c1">// User und Admin implementieren das Interface 'Notifier', indem sie jeweils eine</span>
<span class="c1">// entsprechende 'Notify()'-Methode haben. Eine vorherige Deklaration zur Implementierung</span>
<span class="c1">// ist nicht notwendig.</span>

<span class="kd">func</span><span class="w"> </span><span class="p">(</span><span class="nx">u</span><span class="w"> </span><span class="nx">User</span><span class="p">)</span><span class="w"> </span><span class="nx">Notify</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Printf</span><span class="p">(</span><span class="s">"User: Sending user email to %s\n"</span><span class="p">,</span><span class="w"> </span><span class="nx">u</span><span class="p">.</span><span class="nx">Name</span><span class="p">)</span>
<span class="p">}</span>

<span class="kd">func</span><span class="w"> </span><span class="p">(</span><span class="nx">a</span><span class="w"> </span><span class="nx">Admin</span><span class="p">)</span><span class="w"> </span><span class="nx">Notify</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Printf</span><span class="p">(</span><span class="s">"Admin: Sending admin email to %s. The email address is %q.\n"</span><span class="p">,</span>
<span class="w"> </span><span class="nx">a</span><span class="p">.</span><span class="nx">Name</span><span class="p">,</span><span class="w"> </span><span class="c1">// Verwenden des eingebetteten Feldes 'Name' vom User</span>
<span class="w"> </span><span class="nx">a</span><span class="p">.</span><span class="nx">Email</span><span class="p">)</span>
<span class="p">}</span>

<span class="kd">func</span><span class="w"> </span><span class="nx">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// Einen User und einen Admin erstellen</span>
<span class="w"> </span><span class="nx">user</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">User</span><span class="p">{</span>
<span class="w"> </span><span class="nx">Name</span><span class="p">:</span><span class="w"> </span><span class="s">"john smith"</span><span class="p">,</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="nx">admin</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">Admin</span><span class="p">{</span>
<span class="w"> </span><span class="nx">User</span><span class="p">:</span><span class="w"> </span><span class="nx">user</span><span class="p">,</span>
<span class="w"> </span><span class="nx">Email</span><span class="p">:</span><span class="w"> </span><span class="s">"john@example.com"</span><span class="p">,</span>
<span class="w"> </span><span class="p">}</span>

<span class="w"> </span><span class="c1">// Eine Variable vom Interfacetyp anlegen</span>
<span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">n</span><span class="w"> </span><span class="nx">Notifier</span>

<span class="w"> </span><span class="c1">// Die implementierte Notify-Methode aufrufen</span>
<span class="w"> </span><span class="c1">// Die Methode wird über die Interfacevariable aufgerufen</span>
<span class="w"> </span><span class="c1">// Mittels dynamischer Bindung wird die Methode am richtigen Typ aufgerufen</span>
<span class="w"> </span><span class="nx">n</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">user</span>
<span class="w"> </span><span class="nx">n</span><span class="p">.</span><span class="nx">Notify</span><span class="p">()</span>
<span class="w"> </span><span class="nx">n</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="nx">admin</span>
<span class="w"> </span><span class="nx">n</span><span class="p">.</span><span class="nx">Notify</span><span class="p">()</span>
<span class="p">}</span>
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Nebenläufigkeit"><span id="Nebenl.C3.A4ufigkeit"></span>Nebenläufigkeit</h2></div>
<p>Zur Unterstützung der nebenläufigen Programmierung in Go wird das Konzept der Kanäle <i>(channels)</i> genutzt, das eine relativ stark abstrahierte Möglichkeit der <a href="Synchrone_Kommunikation" title="Synchrone Kommunikation">synchronen</a> oder <a href="Asynchrone_Kommunikation" title="Asynchrone Kommunikation">asynchronen Kommunikation</a> zwischen Go-Routinen bietet. Ein Kanal ist dabei ein Speicherbereich, der durch <a href="Semaphor_(Informatik)" title="Semaphor (Informatik)">Semaphore</a> abgesichert ist und eine <a href="Warteschlange_(Datenstruktur)" title="Warteschlange (Datenstruktur)">Warteschlange</a> (buffered/asynchronous channel) oder lediglich eine Schnittstelle (unbuffered/synchronous channel) zur Verfügung stellt.<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup> Über einen Kanal lassen sich dabei nur Daten eines festen Typs übertragen. Hierbei ist jedoch keinerlei Begrenzung hinsichtlich des Typs gegeben, auch Channels für Channels sind denkbar.<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup>
</p><p>Ein Kanal wird durch den Aufruf <code style="white-space:nowrap">make(chan <i>typ</i>)</code> (synchron) bzw. <code style="white-space:nowrap">make(chan <i>typ</i>, <i>größe</i>)</code> (asynchron, wenn <i>größe</i> &gt; 0) erstellt. Anschließend können Go-Routinen in den Channel schreiben, von ihm lesen und ihn schließen.
</p><p>Bei synchronen Kanälen blockiert ein Lesezugriff, bis eine andere Go-Routine in den Channel schreibt, bzw. der Schreibzugriff, bis eine andere Routine liest.
Bei asynchronen Kanälen tritt ein solches Verhalten nur auf, wenn der zu lesende Channel leer bzw. der zu schreibende Channel voll ist.
Es gibt in Go keine Beschränkung hinsichtlich der Anzahl an Go-Routinen, die einen Channel lesen und schreiben.
Trotz der ausgefeilten Synchronisationsmechanismen kann bei der Benutzung von Channels ein <a href="Deadlock_(Informatik)" title="Deadlock (Informatik)">Deadlock</a> auftreten, der die Go-Laufzeitumgebung veranlasst, das Programm zu beenden.
Eine Go-Routine kann über das <code>select</code>-Konstrukt auf mehreren Channels gleichzeitig lauschen, bzw. versuchen, in mehrere Channels zu schreiben, wobei dasjenige <code>case</code>-Statement ausgeführt wird, das zuerst nicht mehr blockiert, oder es wird im Fall mehrerer Optionen eine <a href="Pseudozufall" title="Pseudozufall">pseudozufällige</a> Wahl getroffen.
</p><p>Daten werden mit <code style="white-space:nowrap"><i>kanal</i> &lt;- <i>Wert</i></code> in einen Kanal geschrieben und mit <code style="white-space:nowrap"><i>variable</i> = &lt;-<i>kanal</i></code> gelesen, wobei beim Lesen die Variablenzuweisung wegfallen kann. Das Lauschen auf einem Channel kann auch mit dem <code>for</code>-Konstrukt automatisiert werden, wobei die <a href="For-Schleife" title="For-Schleife">Schleife</a> verlassen wird, sobald der Channel geschlossen ist.
</p><p>Beispiel:
</p>
<div class="mw-highlight mw-highlight-lang-go mw-content-ltr" dir="ltr"><pre><span></span><span class="kn">package</span><span class="w"> </span><span class="nx">main</span>

<span class="kn">import</span><span class="w"> </span><span class="s">"fmt"</span>

<span class="kd">func</span><span class="w"> </span><span class="nx">zehnMal</span><span class="p">(</span><span class="nx">kanal</span><span class="w"> </span><span class="kd">chan</span><span class="w"> </span><span class="kt">string</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// Argument empfangen</span>
<span class="w"> </span><span class="nx">sag</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="o">&lt;-</span><span class="nx">kanal</span>

<span class="w"> </span><span class="c1">// Zehnmal zurückschreiben</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="w"> </span><span class="p">&lt;</span><span class="w"> </span><span class="mi">10</span><span class="p">;</span><span class="w"> </span><span class="nx">i</span><span class="o">++</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">kanal</span><span class="w"> </span><span class="o">&lt;-</span><span class="w"> </span><span class="nx">sag</span>
<span class="w"> </span><span class="p">}</span>

<span class="w"> </span><span class="c1">// Kanal schließen</span>
<span class="w"> </span><span class="nb">close</span><span class="p">(</span><span class="nx">kanal</span><span class="p">)</span>
<span class="p">}</span>

<span class="kd">func</span><span class="w"> </span><span class="nx">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// synchronen Kanal öffnen</span>
<span class="w"> </span><span class="nx">kanal</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nb">make</span><span class="p">(</span><span class="kd">chan</span><span class="w"> </span><span class="kt">string</span><span class="p">)</span><span class="w"> </span><span class="c1">// oder make(chan string, 0)</span>

<span class="w"> </span><span class="c1">// Starten der parallelen Go-Routine „zehnMal()“</span>
<span class="w"> </span><span class="k">go</span><span class="w"> </span><span class="nx">zehnMal</span><span class="p">(</span><span class="nx">kanal</span><span class="p">)</span>

<span class="w"> </span><span class="c1">// Senden eines Strings</span>
<span class="w"> </span><span class="nx">kanal</span><span class="w"> </span><span class="o">&lt;-</span><span class="w"> </span><span class="s">"Hallo"</span>

<span class="w"> </span><span class="c1">// Empfangen der Strings, bis der Channel geschlossen wird</span>
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nx">s</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="k">range</span><span class="w"> </span><span class="nx">kanal</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="nx">s</span><span class="p">)</span>
<span class="w"> </span><span class="p">}</span>

<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Println</span><span class="p">(</span><span class="s">"Fertig!"</span><span class="p">)</span>
<span class="p">}</span>
</pre></div>
<p>Im Beispiel ruft <code>main()</code> die Go-Routine <code>zehnMal()</code> auf, die einen empfangenen String zehnmal über den gleichen Kanal zurückgibt und ihn danach schließt. Durch den synchronen Kanal warten die beiden Go-Routinen aufeinander, sodass <code>main()</code> erst in die <code>for</code>-Schleife eintritt, wenn <code>zehnMal()</code> den String empfangen hat. Wäre der Kanal nicht synchron, könnte ein Deadlock auftreten, wenn <code>main()</code> die geschriebene Variable sofort wieder liest (und sie dabei aus dem Puffer entfernt) und <code>zehnMal()</code> dadurch vergeblich auf sein Argument wartet. Wichtig ist auch, dass <code>zehnMal()</code> nach dem Schreiben der Strings den Kanal schließt, da <code>main()</code> sonst die Schleife nicht verlassen kann.
</p>
<div class="mw-heading mw-heading2"><h2 id="Implementierungen">Implementierungen</h2></div>
<p>Es gibt mindestens zwei <a href="Compiler" title="Compiler">Compiler</a> für Go, die auf <a href="Linux" title="Linux">Linux</a>, <a href="MacOS" title="MacOS">macOS</a>, <a href="Microsoft_Windows" title="Microsoft Windows">Windows</a> und <a href="FreeBSD" title="FreeBSD">FreeBSD</a> betrieben werden können und die Go-1-Spezifikation vollständig implementieren:
</p>
<dl><dt>Gc</dt>
<dd>ist der offizielle Go-Compiler und wurde initial von Ken Thompson in C geschrieben, basierte auf der „<a href="Plan_9_(Betriebssystem)" title="Plan 9 (Betriebssystem)">Plan&nbsp;9</a>“-<a href="Toolchain" title="Toolchain">Toolchain</a> und nutzte <a href="Yacc" title="Yacc">Yacc</a>/<a href="GNU_Bison" title="GNU Bison">Bison</a> zum <a href="Parser" title="Parser">Parsen</a>. Mit Version 1.5 wurde dieser Compiler von C nach Go übersetzt und ist damit <i>self-hosting</i>. Ursprünglich bestand der Compiler aus mehreren ausführbaren Kommandos, die unterschiedliche Namen je nach Ziel-Architektur hatten: „8&nbsp;g“ für <a href="X86-Architektur" title="X86-Architektur">x86</a>, „6&nbsp;g“ für <a href="AMD64" title="AMD64">x86_64</a>, „5&nbsp;g“ für <a href="ARM-Architektur" title="ARM-Architektur">ARM</a>. Mit Version 1.5 wurden sie zu einem einzelnen ausführbaren Kommando zusammengefasst (<i>go tool compile</i>), und die Ziel-Architektur kann über die Umgebungsvariable <i>GOARCH</i> gewählt werden.</dd>
<dt>Gccgo</dt>
<dd>von Ian Taylor ist ein Go-<a href="Front-End_und_Back-End" class="mw-redirect" title="Front-End und Back-End">Frontend</a> für die <a href="GNU_Compiler_Collection" title="GNU Compiler Collection">GNU Compiler Collection</a> (GCC). Das in <a href="C%2B%2B" title="C++">C++</a> geschriebene Frontend nutzt zum Parsen einen <a href="Rekursiver_Abstieg" title="Rekursiver Abstieg">rekursiven Abstieg</a>. Die folgenden Backend-Schritte sind die der Standard-GCC-Verarbeitung.<sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup> Durch dieses Vorgehen wird zwar die <a href="Kompilierzeit" class="mw-redirect" title="Kompilierzeit">Kompilierzeit</a> im Vergleich zum Gc-Compiler erhöht, jedoch ist der produzierte Code effizienter. Die GNU Compiler Collection (GCC) unterstützt Go 1 mit Version 4.7.1 vollständig,<sup id="cite_ref-16" class="reference"><a href="#cite_note-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup> der <a href="GNU_Debugger" title="GNU Debugger">GNU Debugger</a> (gdb) unterstützt Go ab Version 7.5.<sup id="cite_ref-17" class="reference"><a href="#cite_note-17"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup></dd></dl>
<p>Beide Compiler implementieren eine parallele <a href="Automatische_Speicherbereinigung#Mark-and-Sweep-Algorithmus" class="mw-redirect" title="Automatische Speicherbereinigung">Mark-and-Sweep-Speicherbereinigung</a>.
</p><p>Der offizielle Compiler wird von dem <a href="Kommandozeile" title="Kommandozeile">Kommandozeilen</a>-Werkzeug <i>go</i> begleitet, das als <a href="Fassade_(Entwurfsmuster)" title="Fassade (Entwurfsmuster)">Fassade</a> für verschiedene Werkzeuge dient, wie z.&nbsp;B. dem Installieren von Paketen aus Quelltext-<a href="Repository" title="Repository">Repositories</a> im Internet wie etwa <a href="GitHub" title="GitHub">GitHub</a> oder <a href="Google_Code" class="mw-redirect" title="Google Code">Google Code</a> <i>(go get)</i>, dem automatischen Formatieren von Quelltext <i>(go fmt)</i>, dem Ausführen von <a href="Modultest" title="Modultest">Tests</a> <i>(go test)</i>, dem Erzeugen von Dokumentation aus Quelltext-Kommentaren <i>(go doc)</i> oder dem Kompilieren des Projektes <i>(go build)</i>, sodass keinerlei <a href="Make" title="Make">Makefiles</a> nötig sind, wenn eine empfohlene Verzeichnisstruktur eingehalten wird.
</p>
<div class="mw-heading mw-heading2"><h2 id="Geschichte">Geschichte</h2></div>
<p>Die Entwurfsphase begann am 21.&nbsp;September 2007, anfangs als 20-Prozent-Projekt auf Initiative von Robert Griesemer, Rob Pike und Ken Thompson. Bald darauf stießen weitere Entwickler dazu, und Go wurde zum Vollzeit-Projekt.<sup id="cite_ref-18" class="reference"><a href="#cite_note-18"><span class="cite-bracket">[</span>18<span class="cite-bracket">]</span></a></sup> Am 30.&nbsp;Oktober 2009 wurde Go von Rob Pike in einem Google TechTalk präsentiert und die Veröffentlichung als <a href="Freie_Software" title="Freie Software">freie Software</a> angekündigt, die dann wie angekündigt am 10.&nbsp;November erfolgte.<sup id="cite_ref-19" class="reference"><a href="#cite_note-19"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-20" class="reference"><a href="#cite_note-20"><span class="cite-bracket">[</span>20<span class="cite-bracket">]</span></a></sup> Seitdem sind zahlreiche Beiträge von Entwicklern aus der Go-Community außerhalb Googles hinzugekommen. Am 28. März 2012 wurde Version 1 freigegeben.<sup id="cite_ref-21" class="reference"><a href="#cite_note-21"><span class="cite-bracket">[</span>21<span class="cite-bracket">]</span></a></sup> Seitdem gelten Sprachspezifikation und Standardbibliothek als stabil und sollen innerhalb der 1.x-Serie auf Quelltext-Ebene abwärtskompatibel bleiben.<sup id="cite_ref-22" class="reference"><a href="#cite_note-22"><span class="cite-bracket">[</span>22<span class="cite-bracket">]</span></a></sup> Am 14. Mai 2013 wurde Go 1.1 freigegeben, das vor allem <a href="Rechenleistung" title="Rechenleistung">Performance</a>-Verbesserungen an der Implementierung enthält.<sup id="cite_ref-23" class="reference"><a href="#cite_note-23"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup> Jeweils sechs Monate später erschienen die Versionen Go 1.2 bis Go 1.10.
</p><p>Vom 24. bis zum 26. April 2014 fand die erste Konferenz zu Go, die GopherCon,<sup id="cite_ref-24" class="reference"><a href="#cite_note-24"><span class="cite-bracket">[</span>24<span class="cite-bracket">]</span></a></sup> in <a href="Denver" title="Denver">Denver</a> statt, die seitdem jährlich stattfindet.
</p>
<div class="mw-heading mw-heading2"><h2 id="Maskottchen">Maskottchen</h2></div>

<p>Das Go-<a href="Maskottchen" title="Maskottchen">Maskottchen</a> ist eine <a href="Taschenratte" class="mw-redirect" title="Taschenratte">Taschenratte</a> (englisch <i>Gopher</i>). Es wurde von Renée French entworfen, die auch Glenda, das <a href="Plan_9_(Betriebssystem)" title="Plan 9 (Betriebssystem)">Plan-9</a>-Häschen, entworfen hat. Das <a href="Logo_(Zeichen)" title="Logo (Zeichen)">Logo</a> und das Maskottchen stehen unter der „<a href="Creative_Commons" title="Creative Commons">Creative Commons</a> Attribution 3.0“-Lizenz.
</p>
<div class="mw-heading mw-heading2"><h2 id="Literatur">Literatur</h2></div>
<ul><li>Alan A. A. Donovan, <a href="Brian_W._Kernighan" title="Brian W. Kernighan">Brian W. Kernighan</a>: <cite style="font-style:italic">The Go Programming Language</cite>. Pearson Education, 2015, ISBN 978-0-13-419044-0.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:Go+%28Programmiersprache%29&amp;rft.au=Alan+A.+A.+Donovan%2C+Brian+W.+Kernighan&amp;rft.btitle=The+Go+Programming+Language&amp;rft.date=2015&amp;rft.genre=book&amp;rft.isbn=9780134190440&amp;rft.pub=Pearson+Education" style="display:none">&nbsp;</span></li>
<li>Frank Müller: <cite style="font-style:italic">Systemprogrammierung in Google Go: Grundlagen, Skalierbarkeit, Performanz, Sicherheit</cite>. dpunkt.verlag, Heidelberg 2011, ISBN 978-3-89864-712-0.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:Go+%28Programmiersprache%29&amp;rft.au=Frank+M%C3%BCller&amp;rft.btitle=Systemprogrammierung+in+Google+Go%3A+Grundlagen%2C+Skalierbarkeit%2C+Performanz%2C+Sicherheit&amp;rft.date=2011&amp;rft.genre=book&amp;rft.isbn=9783898647120&amp;rft.place=Heidelberg&amp;rft.pub=dpunkt.verlag" style="display:none">&nbsp;</span></li>
<li>Rainer Feike: <cite style="font-style:italic">Programmierung in Google Go: Neuigkeiten von Google in der Systemprogrammierung</cite>. Addison-Wesley, München/Boston 2010, ISBN 978-3-8273-3009-3.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:Go+%28Programmiersprache%29&amp;rft.au=Rainer+Feike&amp;rft.btitle=Programmierung+in+Google+Go%3A+Neuigkeiten+von+Google+in+der+Systemprogrammierung&amp;rft.date=2010&amp;rft.genre=book&amp;rft.isbn=9783827330093&amp;rft.place=M%C3%BCnchen%2FBoston&amp;rft.pub=Addison-Wesley" style="display:none">&nbsp;</span></li>
<li>Caleb Doxsey: <cite class="lang" lang="en" dir="auto" style="font-style:italic">An Introduction to Programming in Go</cite>. 2012, ISBN 978-1-4783-5582-3 (englisch, <a rel="nofollow" class="external text" href="https://www.golang-book.com/">golang-book.com</a>).<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:Go+%28Programmiersprache%29&amp;rft.au=Caleb+Doxsey&amp;rft.btitle=An+Introduction+to+Programming+in+Go&amp;rft.date=2012&amp;rft.genre=book&amp;rft.isbn=9781478355823" style="display:none">&nbsp;</span></li>
<li>Andreas Schröpfer: <cite style="font-style:italic">Go – Das Praxisbuch</cite>. dpunkt.verlag, 2020, ISBN 978-3-86490-713-5.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:Go+%28Programmiersprache%29&amp;rft.au=Andreas+Schr%C3%B6pfer&amp;rft.btitle=Go+-+Das+Praxisbuch&amp;rft.date=2020&amp;rft.genre=book&amp;rft.isbn=9783864907135&amp;rft.pub=dpunkt.verlag" style="display:none">&nbsp;</span></li>
<li>Kristian Köhler: <cite style="font-style:italic">Microservices mit Go</cite>. Rheinwerk Verlag, 2020, ISBN 978-3-8362-7559-0.<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rfr_id=info:sid/de.wikipedia.org:Go+%28Programmiersprache%29&amp;rft.au=Kristian+K%C3%B6hler&amp;rft.btitle=Microservices+mit+Go&amp;rft.date=2020&amp;rft.genre=book&amp;rft.isbn=9783836275590&amp;rft.pub=Rheinwerk+Verlag" style="display:none">&nbsp;</span></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Weblinks">Weblinks</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://go.dev/">Offizielle Website</a> (englisch)
<ul><li><a rel="nofollow" class="external text" href="https://go.dev/ref/spec">Spezifikation</a> (englisch)</li>
<li><a rel="nofollow" class="external text" href="https://go.dev/tour/">Eine interaktive Einführungs-Tour</a> (englisch)</li></ul></li>
<li>Übersetzungen (deutsch)
<ul><li><a rel="nofollow" class="external text" href="https://www.bitloeffel.de/DOC/golang/go_spec_de.html">Sprachbeschreibung usw.</a></li></ul></li>
<li><a rel="nofollow" class="external text" href="https://go.dev/talks/2012/splash.article">Go at Google: Language Design in the Service of Software Engineering</a> – Artikel von Rob Pike über das Sprachdesign (englisch)</li>
<li><a rel="nofollow" class="external text" href="https://www.youtube.com/watch?v=rKnDgT73v8s">Vortrag von Rob Pike</a> vom 30.&nbsp;Oktober 2009 (<a rel="nofollow" class="external text" href="https://go.dev/talks/2009/go_talk-20091030.pdf">Präsentationsfolien</a> (PDF; 242&nbsp;kB))</li>
<li><a rel="nofollow" class="external text" href="https://gobyexample.com/">Go by example</a> (englisch)</li>
<li><a rel="nofollow" class="external text" href="https://opensource.archium.org/index.php/Der_Golang-Spicker#Ein_Go-Spickzettel_.28.22Cheat_Sheet.22.29">Der Golang-Spicker</a> – kompakte Übersicht (deutsch)</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Einzelnachweise">Einzelnachweise</h2></div>
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-_9774563ad02d3acd-1"><span class="mw-cite-backlink"><a href="#cite_ref-_9774563ad02d3acd_1-0">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://github.com/golang/go/releases/tag/go1.25.5"><cite style="font-style:italic"><span lang="en">Release 1.25.5</span></cite>.</a> 2.&nbsp;Dezember 2025 (abgerufen am 2.&nbsp;Dezember 2025).</span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://www.techcrunch.com/2009/11/10/google-go-language/">Google-go-language</a></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><a href="#cite_ref-3">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://www.youtube.com/watch?v=FTl0tl9BGdc">Why Learn Go?</a> – Kurzinterview mit Rob Pike (Video, englisch)</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><a href="#cite_ref-4">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/talks/2012/splash.article">Go at Google: Language Design in the Service of Software Engineering</a></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><a href="#cite_ref-5">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/doc/faq#no_pointer_arithmetic">go.dev - FAQ-Eintrag zu Zeigerarithmetik</a></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><a href="#cite_ref-6">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://www.youtube.com/watch?v=3DtUzH3zoFo">Origins of Go’s Concurrency Model</a></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><a href="#cite_ref-7">↑</a></span> <span class="reference-text"><span class="cite">Jens Ihlenfeld: <a rel="nofollow" class="external text" href="https://www.golem.de/0911/71113.html"><i>Go - schnelle Programmiersprache von Google.</i></a> In: <i><a href="Golem.de" class="mw-redirect" title="Golem.de">Golem.de</a>.</i> 11.&nbsp;November 2009,<span class="Abrufdatum"> abgerufen am 18.&nbsp;März 2025</span>.</span><span style="display: none;" class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Fde.wikipedia.org%3AGo+%28Programmiersprache%29&amp;rft.title=Go+-+schnelle+Programmiersprache+von+Google&amp;rft.description=Go+-+schnelle+Programmiersprache+von+Google&amp;rft.identifier=https%3A%2F%2Fwww.golem.de%2F0911%2F71113.html&amp;rft.creator=Jens+Ihlenfeld&amp;rft.date=2009-11-11">&nbsp;</span></span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><a href="#cite_ref-8">↑</a></span> <span class="reference-text"><span class="cite"><a rel="nofollow" class="external text" href="https://go.dev/doc/faq#generics"><i>go.dev - FAQ-Eintrag zu Generics.</i></a><span class="Abrufdatum"> Abgerufen am 17.&nbsp;März 2022</span>.</span><span style="display: none;" class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&amp;rfr_id=info%3Asid%2Fde.wikipedia.org%3AGo+%28Programmiersprache%29&amp;rft.title=go.dev+-+FAQ-Eintrag+zu+Generics&amp;rft.description=go.dev+-+FAQ-Eintrag+zu+Generics&amp;rft.identifier=https%3A%2F%2Fgo.dev%2Fdoc%2Ffaq%23generics">&nbsp;</span></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><a href="#cite_ref-9">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/doc/faq#unicode_identifiers">go.dev - FAQ-Eintrag zu Unicode-Bezeichnern</a></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><a href="#cite_ref-10">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/blog/declaration-syntax">go.dev Blogeintrag zu Syntax für Deklarationen</a></span>
</li>
<li id="cite_note-11"><span class="mw-cite-backlink"><a href="#cite_ref-11">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/play/p/GNj0Luvm2FU">Berechnung von Pi auf dem Go-Playground</a> (Beispiel zur nichtsequentiellen Berechnung von Pi)</span>
</li>
<li id="cite_note-12"><span class="mw-cite-backlink"><a href="#cite_ref-12">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/tour/moretypes/1">A Tour Of Go - Pointers</a></span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><a href="#cite_ref-13">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/doc/effective_go#channels">go.dev - Effective Go - Channels</a></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><a href="#cite_ref-14">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/doc/effective_go#chan_of_chan">go.dev - Effective Go - Channels of channels</a></span>
</li>
<li id="cite_note-15"><span class="mw-cite-backlink"><a href="#cite_ref-15">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/doc/faq#Implementation">go.dev - Häufig gestellte Fragen zur Implementierung</a></span>
</li>
<li id="cite_note-16"><span class="mw-cite-backlink"><a href="#cite_ref-16">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://gcc.gnu.org/gcc-4.7/changes.html">GCC 4.7 Release Series Changes, New Features, and Fixes</a></span>
</li>
<li id="cite_note-17"><span class="mw-cite-backlink"><a href="#cite_ref-17">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://sourceware.org/legacy-ml/gdb-announce/2012/msg00004.html">GDB 7.5 Release Notes</a></span>
</li>
<li id="cite_note-18"><span class="mw-cite-backlink"><a href="#cite_ref-18">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/doc/faq">Informationen zur Geschichte in offizieller FAQ</a></span>
</li>
<li id="cite_note-19"><span class="mw-cite-backlink"><a href="#cite_ref-19">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://opensource.googleblog.com/2009/11/hey-ho-lets-go.html">ursprüngliche Nachricht über die Veröffentlichung im Google Open Source Blog</a></span>
</li>
<li id="cite_note-20"><span class="mw-cite-backlink"><a href="#cite_ref-20">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://www.heise.de/ix/meldung/Go-Googles-Programmiersprache-fuer-Abenteuerlustige-855912.html">iX-Artikel vom 11.&nbsp;November 2009</a></span>
</li>
<li id="cite_note-21"><span class="mw-cite-backlink"><a href="#cite_ref-21">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/blog/go1">go.dev - Go version 1 is released</a></span>
</li>
<li id="cite_note-22"><span class="mw-cite-backlink"><a href="#cite_ref-22">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/doc/go1compat">go.dev - Go 1 and the Future of Go Programs</a></span>
</li>
<li id="cite_note-23"><span class="mw-cite-backlink"><a href="#cite_ref-23">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://go.dev/blog/go1.1">go.dev - Go 1.1 is released</a></span>
</li>
<li id="cite_note-24"><span class="mw-cite-backlink"><a href="#cite_ref-24">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://www.gophercon.com/">GopherCon</a></span>
</li>
</ol></div>
<style data-mw-deduplicate="TemplateStyles:r260755238">
/* start https://de.wikipedia.org/ */


.mw-parser-output div.klappleiste{border:1px solid var(--dewiki-rahmenfarbe1);clear:both;font-size:95%;box-sizing:border-box;margin-top:1.5em;padding:2px}.mw-parser-output div.klappleiste:after{clear:both;content:"";display:block}.mw-parser-output div.klappleiste-bild{float:left;padding:2px}.mw-parser-output div.klappleiste-kopf{background:var(--dewiki-hintergrundfarbe5);color:var(--color-base,#202122);text-align:center;font-weight:bold}.mw-parser-output div.klappleiste.mw-collapsed .klappleiste-bild{display:none}.mw-parser-output div.klappleiste+div.klappleiste,.mw-parser-output div.klappleiste+link+div.klappleiste,.mw-parser-output div.klappleiste+link+link+div.klappleiste,.mw-parser-output div.klappleiste+link+style+div.klappleiste,.mw-parser-output div.klappleiste+style+div.klappleiste,.mw-parser-output div.klappleiste+style+style+div.klappleiste,.mw-parser-output div.klappleiste+style+link+div.klappleiste{margin-top:-1px}@media screen{html.skin-theme-clientpref-night .mw-parser-output .klappleiste-bild span[typeof="mw:File"]:not(.skin-invert-image) img{background-color:#c8ccd1}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .klappleiste-bild span[typeof="mw:File"]:not(.skin-invert-image) img{background-color:#c8ccd1}}


/* end https://de.wikipedia.org/ */
</style>
<div class="klappleiste mw-collapsible navileiste navigation-not-searchable center" role="navigation">
<div class="klappleiste-bild nomobile noviewer" aria-hidden="true" role="presentation"><span typeof="mw:File"></span></div>
<div class="klappleiste-kopf">Programmiersprachen von <a href="Google_LLC" title="Google LLC">Google</a></div>
<div class="klappleiste-inhalt mw-collapsible-content">
<div class="centered" style="display: table">
<p><a class="mw-selflink selflink">Go</a>&nbsp;|
<a href="Dart_(Programmiersprache)" title="Dart (Programmiersprache)">Dart</a>&nbsp;|
<a href="Carbon_(Programmiersprache)" title="Carbon (Programmiersprache)">Carbon</a>
</p>
</div>
</div></div>
<div class="hintergrundfarbe1 rahmenfarbe1 navigation-not-searchable normdaten-typ-s" style="border-style: solid; border-width: 1px; clear: left; margin-bottom:1em; margin-top:1em; padding: 0.25em; overflow: hidden; word-break: break-word; word-wrap: break-word;" id="normdaten">
<div style="display: table-cell; vertical-align: middle; width: 100%;">
<div>
Normdaten&nbsp;(Sachbegriff): <a href="Gemeinsame_Normdatei" title="Gemeinsame Normdatei">GND</a>: <span class="-print"><a rel="nofollow" class="external text" href="https://d-nb.info/gnd/7725033-3">7725033-3</a></span> | <a href="Library_of_Congress_Control_Number" title="Library of Congress Control Number">LCCN</a>: <span class="-print"><a rel="nofollow" class="external text" href="https://id.loc.gov/authorities/sh2012000746">sh2012000746</a></span> </div>
</div></div></div><!--htdig_noindex--><div><div class="zim-footer">
Dieser Artikel wurde von <a class="external text" title="Zuletzt bearbeitet am 2025-12-31" href="https://de.wikipedia.org/wiki/?title=Go_(Programmiersprache)&amp;oldid=262899925">Wikipedia</a> herausgegeben. Der Text ist unter <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.de">Creative Commons Attribution-Share Alike 4.0</a> verfügbar, sofern nicht anders angegeben. Für die Mediendateien können zusätzliche Bedingungen gelten.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
<script src="./_webp_/webpHandler.js"></script>

</body></html>